﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="He.Web.manage.pictures.list" %>

<%@ Register Src="../_uc/head_list.ascx" TagPrefix="uc" TagName="head_list" %>
<%@ Register Src="../_uc/head.ascx" TagPrefix="uc" TagName="head" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>内容列表</title>
    <uc:head runat="server" ID="uchead" />
    <uc:head_list runat="server" ID="uchead_list" />
    <script type="text/javascript">
        $(function () {
            //点击激活输入框
            $(".title_td").attr("title", "双击修改");
            $(".title_td").bind("dblclick", function () {
                if (editing == false) {
                    var txt = $.trim($(this).html());
                    $(this).html("<input type='text' value='" + txt + "' tid='" + $(this).attr('id') + "' class='title'  onblur='save_title(this,<%=channel_id %>)'/>");
                    $(".title").focus();
                    editing = true;
                }
            });
        });
    </script>
</head>
<body style="padding: 10px;">
    <form id="form1" runat="server">
    <div class="navigation">
        <span class="add"><a href='edit.aspx?channel_id=<%=channel_id %>'>发布内容</a></span><span
            class="add"> <a href="../batch/add_pic.aspx?channel_id=<%=channel_id %>">批量上传</a></span>
        <b>您当前的位置：首页 &gt;
            <%=channel.manage_title%>&gt;内容列表</b>
    </div>
    <div class="spClear">
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="50" align="center">
                请选择：
            </td>
            <td>
                <asp:DropDownList ID="ddlcategory_id" runat="server" CssClass="select" OnSelectedIndexChanged="ddlcategory_id_SelectedIndexChanged"
                    AutoPostBack="True">
                </asp:DropDownList>
                &nbsp;
                <asp:DropDownList ID="ddlProperty" runat="server" CssClass="select" OnSelectedIndexChanged="ddlProperty_SelectedIndexChanged"
                    AutoPostBack="True">
                    <asp:ListItem Value="">所有属性</asp:ListItem>
                    <asp:ListItem Value="isRed">推荐</asp:ListItem>
                    <asp:ListItem Value="isLock">隐藏</asp:ListItem>
                    <asp:ListItem Value="isHot">热门</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td width="50" align="right">
                关健字：
            </td>
            <td width="150">
                <asp:TextBox ID="txtKeywords" runat="server" CssClass="keyword"></asp:TextBox>
            </td>
            <td width="60" align="center">
                <asp:Button ID="btnSelect" runat="server" Text="查询" CssClass="submit" OnClick="btnSelect_Click" />
            </td>
        </tr>
    </table>
    <div class="spClear">
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
        <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand">
            <HeaderTemplate>
                <tr>
                    <th width="5%">
                        选择
                    </th>
                    <th width="5%">
                        编号
                    </th>
                    <th>
                        名称
                    </th>
                    <th width="15%">
                        缩略图
                    </th>
                    <th width="15%">
                        所属类别
                    </th>
                    <th width="10%">
                        排序
                    </th>
                    <th width="15%">
                        发布时间
                    </th>
                    <th width="5%">
                        属性
                    </th>
                    <th width="8%">
                        操作
                    </th>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:CheckBox ID="cb_id" CssClass="checkall" runat="server"></asp:CheckBox>
                    </td>
                    <td>
                        <asp:Label ID="lb_id" runat="server" Text='<%#Eval("id")%>'></asp:Label>
                    </td>
                    <td class="title_td" id="<%#Eval("id") %>">
                        <%#Eval("title") %>
                    </td>
                    <td>
                        <a href="edit.aspx?id=<%#Eval("id") %>&channel_id=<%=channel_id %>&action=<%=He.Web.UI.Enums.ActionEnum.Edit %>">
                            <img src="<%#Eval("img_url") %>" width="40" height="40" /></a>
                    </td>
                    <td>
                        <%#CategorySelectBind(channel_id, Eval("category_id"),Eval("id"))%>
                    </td>
                    <td>
                        <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort_id")%>' CssClass="txtInput2 small2"
                            onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" />
                    </td>
                    <td>
                        <%#Eval("add_time") %>
                    </td>
                    <td>
                        <asp:ImageButton ID="ibtnRed" CommandName="ibtnRed" runat="server" ImageUrl='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "../Images/ico-2.png" : "../Images/ico-2_.png"%>'
                            ToolTip='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "取消推荐" : "设置推荐"%>' />
                        <asp:ImageButton ID="ibtnHot" CommandName="ibtnHot" runat="server" ImageUrl='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "../Images/ico-3.png" : "../Images/ico-3_.png"%>'
                            ToolTip='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "取消热门" : "设置热门"%>' />
                    </td>
                    <td>
                        <a href="edit.aspx?id=<%#Eval("id") %>&channel_id=<%=channel_id %>&action=<%=He.Web.UI.Enums.ActionEnum.Edit %>">
                            修改</a> <a href="../comment/list.aspx?channel_id=<%=channel.id %>&pid=<%#Eval("id") %>">
                                评论(<%#GetCommentCount(channel.id,Convert.ToInt32(Eval("id"))) %>) </a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
    <div class="spClear">
    </div>
    <div style="line-height: 30px; height: 30px;">
        <%=He.Web.UI.HtmlHelper.PagerText(pcount, pageSize, page, "?"+CombUrlTxt(this.channel_id,this.category_id, this.keywords, this.property)+"page=__id__")%>
        <div class="left">
            <span class="btn_all" onclick="CheckAll(this)">全 选</span> <span class="btn_bg">
                <asp:LinkButton ID="lbtnDel" runat="server" OnClick="lbtnDel_Click" OnClientClick="return confirm( '确定要删除这些记录吗？ ');">删除</asp:LinkButton></span>
            <span class="btn_bg">
                <asp:LinkButton ID="lbtnSave" runat="server" OnClick="lbtnSave_Click">保存排序</asp:LinkButton></span>
            <span class="btn_bg">
                <asp:LinkButton ID="btnRed" runat="server" ToolTip="设置所选推荐" OnClick="btnRed_Click">设置所选推荐</asp:LinkButton>
            </span><span class="btn_bg">
                <asp:LinkButton ID="btnNotRed" runat="server" ToolTip="取消所选推荐" OnClick="btnNotRed_Click">取消所选推荐</asp:LinkButton>
            </span><span class="btn_bg">
                <asp:LinkButton ID="btnHot" runat="server" ToolTip="设置所选热门" OnClick="btnHot_Click">设置所选热门</asp:LinkButton>
            </span><span class="btn_bg">
                <asp:LinkButton ID="btnNotHot" runat="server" ToolTip="取消所选热门" OnClick="btnNotHot_Click">取消所选热门</asp:LinkButton>
            </span><span class="btn_bg">
                <asp:LinkButton ID="btnTongbu" runat="server" OnClick="btnTongbu_Click">同步所选到G宝盆</asp:LinkButton></span>
        </div>
    </div>
    </form>
</body>
</html>
